<html xmlns='http://www.w3.org/1999/xhtml'
      xmlns:p='http://primefaces.org/ui'
      xmlns:f='http://java.sun.com/jsf/core'
      xmlns:h='http://java.sun.com/jsf/html'
      xmlns:fn='http://java.sun.com/jsp/jstl/functions'
      xmlns:cc='http://java.sun.com/jsf/composite' style='color: inherit'>

<cc:interface>

<cc:attribute name='id'/>

<cc:attribute name='b'/>

<cc:attribute name='p'/>

<cc:attribute name='t'       default='#{cc.attrs.p}'/>

<cc:attribute name='x'       default='s'/>

<cc:attribute name='wT'       default='65'/>

<cc:attribute name='w'     default='250px'/>

<cc:attribute name='maxL'    default='#{cc.attrs.b.entityLsProperty[fn:toLowerCase(cc.attrs.p)][2]}'/>

<cc:attribute name='read'    default='#{cc.attrs.b.isRead}'/>

<cc:attribute name='pattern' default='dd.MM.yyyy'/>

<cc:attribute name='onkeydown'/>

<cc:attribute name='onkeypress'/>

</cc:interface>


<cc:implementation>

<h:panelGrid columns='2' cellpadding='0' cellspacing='0' styleClass='align-text-bottom'>

  <h:panelGrid columns='1' cellpadding='0' cellspacing='1' width='#{cc.attrs.wT}' styleClass="#{cc.attrs.read? '':'ui-state-default xFd'}"><span title='#{cc.attrs.maxL}'>#{cc.attrs.t}</span></h:panelGrid>


  <h:panelGroup id='inputDate'>

  <p:calendar   value='#{cc.attrs.b.entity[fn:toLowerCase(cc.attrs.p)]}' rendered="#{!cc.attrs.read and cc.attrs.x =='s'}" navigator='true' pattern='#{cc.attrs.pattern}' style='width: #{cc.attrs.w}' styleClass='xAuto' maxlength='#{cc.attrs.maxL}' onkeydown='#{cc.attrs.onkeydown}' onkeypress='#{cc.attrs.onkeypress}'/>

  <h:outputText value='#{cc.attrs.b.entity[fn:toLowerCase(cc.attrs.p)]}' rendered="#{ cc.attrs.read and cc.attrs.x =='s'}" style='width: #{cc.attrs.w}; font-weight: bold'><f:convertDateTime pattern='#{cc.attrs.pattern}'/></h:outputText>

  <p:calendar   value='#{cc.attrs.b.entity[fn:toLowerCase(cc.attrs.p)]}' rendered="#{!cc.attrs.read and cc.attrs.x =='t'}" navigator='true' pattern='#{cc.attrs.pattern} HH:mm' style='width: #{cc.attrs.w}' styleClass='xAuto' maxlength='#{cc.attrs.maxL}' onkeydown='#{cc.attrs.onkeydown}' onkeypress='#{cc.attrs.onkeypress}'/>

  <h:outputText value='#{cc.attrs.b.entity[fn:toLowerCase(cc.attrs.p)]}' rendered="#{ cc.attrs.read and cc.attrs.x =='t'}" style='width: #{cc.attrs.w}; font-weight: bold'><f:convertDateTime pattern='#{cc.attrs.pattern} HH:mm'/></h:outputText>

  </h:panelGroup>

</h:panelGrid>

</cc:implementation>

</html>